<?PHP
$PageID=5;
$nohead=1;
//不需要头部
include_once('../../../core/common.php');
//echo $_GET['PageID'];

if($_GET['AuthSystem']==2){
	$sql = "update pages set PageName='{$_GET['PageName']}',PageUrl='{$_GET['PageUrl']}' where PageID='{$_GET['PageID']}'";
	$db_result=run_sql($sql,1);
	$result1 =mysqli_query( $db_result ,$sql);//执行sql
	if(mysqli_affected_rows($db_result)==1){
			echo '
					<script  type="text/javascript" >
					var index = parent.layer.getFrameIndex(window.name);
					parent.layer.msg("修改成功！");
					parent.layer.close(index);
					</script>
			';	
				// $data['code'] = 0 ;
				// $data['msg'] = "修改成功！" ;
				// echo json_encode($data);
				// exit;
				
				}else{
					
			echo '
					<script  type="text/javascript" >
					parent.layer.msg("修改失败,请重试！mysqli_affected_rows='.mysqli_affected_rows($db_result).'");
					</script>
			';	
				// $data['code'] = 1 ;
				// $data['msg'] = "修改失败,请重试！mysqli_affected_rows=".mysqli_affected_rows($db_result) ;
				// echo json_encode($data);
				}
}elseif($_GET['AuthSystem']!=1){
$data['code'] = 2 ;
$data['msg'] = "非法访问(AuthSystem=1)" ;
echo json_encode($data);
exit;
}



?>





<form class="layui-form layui-form-pane"  id="EditForm" >
				<div class="layui-form-item">
					<div class="layui-row">
				
						<div class="layui-col-xs3">
      
							<label class="layui-form-label layui-form-required" style="width: 110px;">
								<span style="color:red;"> *</span> 页面ID:
							</label>
						
							<div class="layui-input-block" style="margin-left: 110px">
								<input name="PageID" value="<?PHP echo $_GET['PageID']; ?>" placeholder="仅可在数据库中修改" class="layui-input" lay-vertype="tips" lay-verify="required" readonly=""  style="width:100%">
							</div>
					
						</div>
					
						<div class="layui-col-xs9">
    
							<label class="layui-form-label layui-form-required" style="width: 110px;">
								<span style="color:red;">*</span> 页面名称:
							</label>
					
							<div class="layui-input-block" style="margin-left: 110px">
								<input name="PageName" value="<?PHP echo $_GET['PageName']; ?>" placeholder="请输入页面名称" class="layui-input" lay-vertype="tips" lay-verify="required" style="width:100%">
							</div>
					
						</div>
						
					</div>
				</div>
				
				<div class="layui-form-item">
					<label class="layui-form-label layui-form-required" style="width: 110px;">
						<span style="color:red;"> *</span> 页面Url:
					</label>
						
					<div class="layui-input-block" style="margin-left: 110px">
						<input name="PageUrl" value="<?PHP echo $_GET['PageUrl']; ?>" placeholder="请输入相对根目录的页面路径" class="layui-input " lay-vertype="tips" lay-verify="required" style="width:100%">
						<input name="AuthSystem" value="2" type="hidden">
					
					</div>
				</div>
				
				<div class="layui-form-item">
				
                    <div class="layui-input-block">
					
                        <button  class="layui-btn" lay-submit="" lay-filter="formPreviewForm">提交</button>
						
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
						
                    </div>
					
                </div>
				
				
			</form>
			
			
			